package com.xyw.code.study202007291.functiontet;

import java.util.function.Consumer;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/7/30
 * Time: 上午8:55
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
public class ConsumerTest {
    public static void main(String[] args) {
        Consumer<Integer> consumer1 = x-> System.out.println(x+1);
        Consumer<Integer> consumer2 = x-> System.out.println(x+2);
        consumer1.accept(1);
        consumer1.andThen(consumer2).accept(2);
    }
}
